import React, {PureComponent} from 'react'

export class CounterClass extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            counter: 0
        }
    }

    render() {

        const {counter} = this.state;
        return (
            <div>'
                <h2>CounterClass:{counter}</h2>
                <button onClick={e =>
                    this.setState({
                        counter: counter + 1
                    })
                }>+1</button>
                <button onClick={e =>
                    this.setState({
                        counter: counter - 1
                    })
                }>-1</button>
            </div>
        )
    }
}

export default CounterClass